package com.github.yoojia.mqtt.boot;

import com.github.yoojia.mqtt.LocalFilter;
import com.github.yoojia.mqtt.Message;

/**
 * @author Yoojia Chen (yoojiachen@gmail.com)
 * @since 1.0.0
 */
public class TagFilter implements LocalFilter {

    private final String mExpectTag;

    public TagFilter(String expectTag) {
        mExpectTag = expectTag;
    }

    @Override
    public boolean test(Message item) {
        return mExpectTag.equals(item.tag);
    }
}
